﻿<Window x:Class="GurLoader.View.PreferencesWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:view="clr-namespace:GurLoader.View"
        Title="GurLoader Preferences"
        Icon="/Resources/settings_32.png"
        Height="450" Width="600">
    <Grid Margin="4,4,4,4">
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>

        <Grid Grid.Row="0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="1*"/>
                <ColumnDefinition Width="5"/>
                <ColumnDefinition Width="3*"/>
            </Grid.ColumnDefinitions>

            <TreeView Grid.Column="0" SelectedItemChanged="TreeView_OnSelectedItemChanged" >
                <TreeViewItem Header="General" IsExpanded="True">
                    <TreeViewItem Header="General"/>
                </TreeViewItem>
                <TreeViewItem Header="Screen Capture" IsExpanded="True">
                    <TreeViewItem Header="Shortcuts"/>
                </TreeViewItem>
            </TreeView>

            <GridSplitter Grid.Column="1" Width="5" HorizontalAlignment="Stretch"/>

            <TabControl Grid.Column="2" x:Name="tabcontrol">
                <TabItem Header="General\General" Visibility="Collapsed">
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>

                        <CheckBox Grid.Row="0" Grid.ColumnSpan="2" Grid.Column="0"
                      IsChecked="{Binding AppPreferences.OpenWhenComplete, Mode=TwoWay}">Auto-Open In Browser</CheckBox>

                        <CheckBox Grid.Row="1" Grid.ColumnSpan="2" Grid.Column="0"
                      IsChecked="{Binding AppPreferences.UseAnonymousContext, Mode=TwoWay}">Send to Imgur as anonymous user</CheckBox>

                    </Grid>
                </TabItem>
                <TabItem Header="Screen Capture\Shortcuts" Visibility="Collapsed">
                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>

                        <StackPanel Orientation="Vertical" Grid.Row="0">
                            <CheckBox
                          IsChecked="{Binding AppPreferences.FullScreenCaptureEnabled, Mode=TwoWay}" Content="Enable Full-Screen Capture" Name="FullScreenCaptureEnabledCheckbox"/>
                            <StackPanel Orientation="Horizontal" Margin="10,3,0,3">
                                <Label IsEnabled="{Binding AppPreferences.FullScreenCaptureEnabled}">Hotkey:</Label>
                                <view:HotKeyTextBox MinWidth="100" Margin="10,0,0,0"
                                        IsEnabled="{Binding AppPreferences.FullScreenCaptureEnabled}"
                                        ShortcutKey="{Binding AppPreferences.FullScreenCaptureKey, Mode=TwoWay}"
                                        ShortcutModifierKeys="{Binding AppPreferences.FullScreenCaptureModifierKeys, Mode=TwoWay}"/>
                            </StackPanel>
                        </StackPanel>

                        <StackPanel Orientation="Vertical" Grid.Row="1">
                            <CheckBox IsChecked="{Binding AppPreferences.AreaScreenCaptureEnabled, Mode=TwoWay}" Content="Enable Sceen Area Capture" Name="AreaCaptureEnabledCheckbox"/>
                            <StackPanel Orientation="Horizontal" Margin="10,3,0,3">
                                <Label IsEnabled="{Binding AppPreferences.AreaScreenCaptureEnabled}">Hotkey:</Label>
                                <view:HotKeyTextBox MinWidth="100" Margin="10,0,0,0"
                                        IsEnabled="{Binding AppPreferences.AreaScreenCaptureEnabled}"
                                        ShortcutKey="{Binding AppPreferences.AreaScreenCaptureKey, Mode=TwoWay}"
                                        ShortcutModifierKeys="{Binding AppPreferences.AreaScreenCaptureModifierKeys, Mode=TwoWay}"/>
                            </StackPanel>
                        </StackPanel>
                    </Grid>
                </TabItem>
            </TabControl>
        </Grid>

        <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Grid.Row="1">
            <Button Content="OK" 
                Command="{Binding OkCommand}"
                Margin="4,4,4,4"
                HorizontalAlignment="Left"
                VerticalAlignment="Top" Width="75"/>
            <Button Content="Cancel" 
                Command="{Binding CancelCommand}"
                Margin="4,4,4,4"
                HorizontalAlignment="Left"
                VerticalAlignment="Top" Width="75" RenderTransformOrigin="-0.067,2.091"/>

        </StackPanel>
    </Grid>
    <!--
    <Grid Margin="4,4,4,4">
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        
        <Grid Grid.Row="0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>        
            <Grid.RowDefinitions> 
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>

            <CheckBox Grid.Row="0" Grid.ColumnSpan="2" Grid.Column="0"
                      IsChecked="{Binding AppPreferences.OpenWhenComplete, Mode=TwoWay}">Auto-Open In Browser</CheckBox>

            <CheckBox Grid.Row="1" Grid.ColumnSpan="2" Grid.Column="0"
                      IsChecked="{Binding AppPreferences.UseAnonymousContext, Mode=TwoWay}">Send to Imgur as anonymous user</CheckBox>
            
            <StackPanel Orientation="Vertical" Grid.Row="2" Grid.Column="2">
                <TextBlock>Full Screen Capture Hotkey</TextBlock>
                <StackPanel Orientation="Horizontal">
                    <CheckBox
                          IsChecked="{Binding AppPreferences.FullScreenCaptureEnabled, Mode=TwoWay}"/>
                    <view:HotKeyTextBox MinWidth="100" Margin="10,0,0,0"
                                        IsEnabled="{Binding AppPreferences.FullScreenCaptureEnabled}"
                                        ShortcutKey="{Binding AppPreferences.FullScreenCaptureKey, Mode=TwoWay}"
                                        ShortcutModifierKeys="{Binding AppPreferences.FullScreenCaptureModifierKeys, Mode=TwoWay}"/>
                </StackPanel>
            </StackPanel>

            <StackPanel Orientation="Vertical" Grid.Row="3" Grid.Column="2">
                <TextBlock>Area Screen Capture Hotkey</TextBlock>
                <StackPanel Orientation="Horizontal">
                    <CheckBox
                          IsChecked="{Binding AppPreferences.AreaScreenCaptureEnabled, Mode=TwoWay}"/>
                    <view:HotKeyTextBox MinWidth="100" Margin="10,0,0,0"
                                        IsEnabled="{Binding AppPreferences.AreaScreenCaptureEnabled}"
                                        ShortcutKey="{Binding AppPreferences.AreaScreenCaptureKey, Mode=TwoWay}"
                                        ShortcutModifierKeys="{Binding AppPreferences.AreaScreenCaptureModifierKeys, Mode=TwoWay}"/>
                </StackPanel>
            </StackPanel>
            
        </Grid>
        <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Grid.Row="1">
            <Button Content="OK" 
                Command="{Binding OkCommand}"
                Margin="4,4,4,4"
                HorizontalAlignment="Left"
                VerticalAlignment="Top" Width="75"/>
            <Button Content="Cancel" 
                Command="{Binding CancelCommand}"
                Margin="4,4,4,4"
                HorizontalAlignment="Left"
                VerticalAlignment="Top" Width="75" RenderTransformOrigin="-0.067,2.091"/>
            
        </StackPanel>
    </Grid>
    -->
</Window>
